<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')

			///////////////

			uni.getSystemInfo({
				success: e => {
					this.globalData.statusBar = e.statusBarHeight; //状态栏高度
					let custom = {
						width: 0,
						height: 28,
						top: 0,
						left: 0,
						right: 0,
						bottom: 0
					}; //菜单按钮
					//#ifdef MP-WEIXIN || MP-ALIPAY
					custom = uni.getMenuButtonBoundingClientRect() || {}; //菜单按钮
					if (custom.height == 0) {
						custom.height = 40;
						console.log('未获取到custom，手动设置为', custom);
					}
					//#endif

					this.globalData.custom = custom;
					if (e.safeArea) {
						// #ifdef MP-WEIXIN
						this.globalData.safeArea = e.screenHeight - e.safeArea.bottom
						// #endif
						// #ifndef MP-WEIXIN
						this.globalData.safeArea = e.safeAreaInsets.bottom
						// #endif
					} else {
						this.globalData.safeArea = 0
					}
					this.globalData.screenWidth = e.screenWidth;
					this.globalData.screenHeight = e.screenHeight;
					this.globalData.customBar = (custom.bottom + custom.top - e.statusBarHeight) > 0 ?
						(custom.bottom + custom.top - e.statusBarHeight) : (custom.height + e
							.statusBarHeight);
					//#ifdef H5 || APP-PLUS
					this.globalData.customBar = 50 + e.statusBarHeight;
					//#endif


					// #ifdef H5

					let url = window.location.href;
					if (url.indexOf('custom=1') > -1) {
						//苹果加状态栏
						this.globalData.statusBar = 44;
						this.globalData.customBar = 50 + 44;
					}
					// #endif

				}
			});
			///////////////

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import "@/components/common/iconfont.css";

	/*每个页面公共css */
	.flex {
		display: flex;
		flex-direction: column;
	}

	.flex-x {
		flex-direction: row;
	}

	.flex-y {
		flex-direction: column;
	}

	.flex-x-center {
		justify-content: center;
	}

	.flex-y-center {
		align-items: center;
	}

	.flex-y-end {
		align-items: flex-end;
	}

	.flex-y-start {
		align-items: flex-start;
	}

	.flex-x-b {
		justify-content: space-between;
	}

	.flex-x-a {
		justify-content: space-around;
	}

	.flex-x-start {
		justify-content: flex-start;
	}

	.flex-x-end {
		justify-content: flex-end;
	}

	.flex-y {
		display: flex;
		flex-flow: column nowrap;
	}


	.flex-x-b {
		justify-content: space-between;
	}

	.flex-wrap {
		flex-wrap: wrap;
	}

	.flex-1 {
		flex: 1;
	}

	.flex-x-y {
		justify-content: center;
		align-items: center;
	}

	.hover-o {
		transition: opacity 0.14s;
	}

	.hover-o:active {
		opacity: 0.8;
	}

	.color-999999 {
		color: #999;
	}

	.color-333333 {
		color: #333;
	}

	.color-666666 {
		color: #666;
	}

	/* #ifdef H5 */
	body {
		background-color: #f7f7f7;
	}

	uni-modal .uni-modal {
		border-radius: 10px;
		padding-top: 15px;
	}

	uni-modal .uni-modal__ft {
		line-height: 60px;
	}

	uni-modal .uni-modal__bd {
		font-size: 18px;
	}

	/* #endif */

	/* #ifndef APP-NVUE */


	@font-face {
		font-family: "PingFang";
		src: url("https://oss.file.qicheliliang.com/font/PINGFANG_MEDIUM.subset.woff2");
	}

	@font-face {
		font-family: "numberff";
		src: url("https://oss.file.qicheliliang.com/image/new-weibao/number.ttf");
	}

	.number-font {
		font-family: "numberff", "PingFang SC", "PingFang";
	}

	page {
		/* #ifdef H5 || APP-PLUS || MP-WEIXIN */
		font-family: "PingFang SC", "PingFang";
		/* #endif */
		font-size: 28rpx;
	}


	/* #endif */
</style>